Use grid module for StandardLayout#15428
Conversation
c8e046d to
b0f4bf5
Compare
StandardLayoutStandardLayout
bb14535 to
b752a6f
Compare
StandardLayoutStandardLayout, introduce vertical rules
ab9a1c2 to
0646448
Compare
|
Hello 👋! When you're ready to run Chromatic, please apply the You will need to reapply the label each time you want to run Chromatic. |
81a91f8 to
e67e85c
Compare
2357924 to
cf39bf7
Compare
cbee04b to
12ef9bb
Compare
60a6347 to
31dca25
Compare
JamieB-gu
left a comment
There was a problem hiding this comment.
Great work @frederickobrien ! A few comments/questions, I don't think anything blocking.
I assume this will need reconciling with the changes in #15951?
| } as const; | ||
|
|
||
| // ----- Types ----- // | ||
| type ColumnPreset = keyof typeof grid.column; |
There was a problem hiding this comment.
Where is this export used?
Co-Authored-By: Jamie B <53781962+JamieB-gu@users.noreply.github.com>
|
Seen on PROD (merged by @frederickobrien 25 minutes and 42 seconds ago) Please check your changes! |
|
Spectacular work Fred! Just documenting some of the issues after the release of this, so we have a checklist for future grid updates: Affiliate disclaimer: Interscroller ads, due to a z-index issue: Lightbox layout: Where possible we should improve our testing so we catch any regressions earlier. |
What does this change and why?
This refactors the
StandardLayoutto use thegridmodule, which itself implements the Guardian Grid, hopefully making it easier to reason with and style. This is with one eye on header standardisation work by @guardian/articles-and-publishing as well as a potential revamp of the interactive layout (see #15358).As part of this I've had a stab at introducing
verticalRulesto thegridmodule, allowing for lines to be added if they're wanted. After a few iterations I've made this something that's pure CSS and baked into the grid module itself.verticalRulesadds outer borders, whileverticalRules({ centre: true })adds an additional one to the left hand side of the centre column.While there are ongoing questions about how best to abstract the config I think the overall outcome here is good, with the grid module and configuration options being something that could be applied to other layouts going forward.
A glimpse of the sorts of things this could enable: #15509
I'm probably missing subtler differences but I think with these changes the following layouts could be (easily in some cases) absorbed into
StandardLayout, with thousands of lines of duplicate code lost in the process:ShowcaseLayout(Move ShowcaseLayout to grid #16119)AudioLayout(Move AudioLayout to grid #16133)CommentLayoutPictureLayout(Move PictureLayout to grid #16251)ImmersiveLayout(Revamped immersive layout(s) #15922)A few open questions:
maxWidthwrappers? (I think yes)Context
Examples of different layouts
Standard
Showcase
Screenshots